
class LogUtils {

  private static instance:LogUtils
  private storageName = 'log'

 

  public static getInstance():LogUtils{
      if(!LogUtils.instance){
        LogUtils.instance = new LogUtils()
      }
      return LogUtils.instance
  }

   /* 
     保存日志
   */
  public saveLog(log: any) {
    localStorage.setItem('log', JSON.stringify(log))
  }

  /* 
     获取日志
  */
  public getLog() {
    return JSON.parse(localStorage.getItem('log') || '{}')
  }

  /* 
     删除日志
  */
  public deleteLog() {
    localStorage.removeItem('log')
  }
}

export default LogUtils
